<?xml version="1.0" encoding="utf-8"?>
<databaseChangeLog
    xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-latest.xsd">
<%_ if (liquibaseAddH2Properties) { _%>
    <property name="now" value="now()" dbms="h2"/>
    <property name="floatType" value="float4" dbms="h2"/>
  <%_ if (prodDatabaseTypeMysql || prodDatabaseTypeMariadb) { _%>
    <property name="uuidType" value="varchar(36)" dbms="h2"/>
  <%_ } else { _%>
    <property name="uuidType" value="uuid" dbms="h2"/>
  <%_ } _%>
    <property name="datetimeType" value="datetime(6)" dbms="h2"/>
    <property name="timeType" value="time(6)" dbms="h2"/>
  <%_ if (prodDatabaseTypePostgresql) { _%>
    <property name="clobType" value="longvarchar" dbms="h2"/>
  <%_ } else { _%>
    <property name="clobType" value="clob" dbms="h2"/>
  <%_ } _%>
    <property name="blobType" value="blob" dbms="h2"/>
<%_ } _%>
<%_ if (prodDatabaseTypeMysql) { _%>
    <property name="now" value="now()" dbms="mysql"/>
    <property name="floatType" value="float" dbms="mysql"/>
    <property name="clobType" value="clob" dbms="mysql"/>
    <property name="blobType" value="longblob" dbms="mysql"/>
    <property name="uuidType" value="varchar(36)" dbms="mysql"/>
    <property name="datetimeType" value="datetime(6)" dbms="mysql"/>
    <property name="timeType" value="time(6)" dbms="mysql"/>
<%_ } _%>
<%_ if (prodDatabaseTypeMariadb) { _%>
    <property name="now" value="now()" dbms="mariadb"/>
    <property name="floatType" value="float" dbms="mariadb"/>
    <property name="clobType" value="clob" dbms="mariadb"/>
    <property name="blobType" value="longblob" dbms="mariadb"/>
    <property name="uuidType" value="varchar(36)" dbms="mariadb"/>
    <property name="datetimeType" value="datetime(6)" dbms="mariadb"/>
    <property name="timeType" value="time(6)" dbms="mariadb"/>
<%_ } _%>
<%_ if (prodDatabaseTypePostgresql) { _%>
    <property name="now" value="current_timestamp" dbms="postgresql"/>
    <property name="floatType" value="float4" dbms="postgresql"/>
    <property name="clobType" value="clob" dbms="postgresql"/>
  <%_ if (reactive) { _%>
    <%_
      // hibernate/liquibase maps Blob type to oid by default https://liquibase.jira.com/browse/CORE-1863
      // r2dbc-postgresql doesn't support mapping Blob to oid https://github.com/pgjdbc/r2dbc-postgresql/issues/255
    _%>
    <property name="blobType" value="bytea" dbms="postgresql"/>
  <%_ } else { _%>
    <property name="blobType" value="blob" dbms="postgresql"/>
  <%_ } _%>
    <property name="uuidType" value="uuid" dbms="postgresql"/>
    <property name="datetimeType" value="datetime" dbms="postgresql"/>
    <property name="timeType" value="time(6)" dbms="postgresql"/>
<%_ } _%>
<%_ if (prodDatabaseTypeOracle) { _%>
    <property name="now" value="sysdate" dbms="oracle"/>
    <property name="floatType" value="float" dbms="oracle"/>
    <property name="clobType" value="clob" dbms="oracle"/>
    <property name="blobType" value="blob" dbms="oracle"/>
    <property name="uuidType" value="uuid" dbms="oracle"/>
    <property name="datetimeType" value="datetime" dbms="oracle"/>
    <property name="timeType" value="time" dbms="oracle"/>
<%_ } _%>
<%_ if (prodDatabaseTypeMssql) { _%>
    <property name="now" value="GETDATE()" dbms="mssql"/>
    <property name="floatType" value="float" dbms="mssql"/>
    <property name="clobType" value="clob" dbms="mssql"/>
    <property name="blobType" value="blob" dbms="mssql"/>
    <property name="uuidType" value="uuid" dbms="mssql"/>
    <property name="datetimeType" value="datetime" dbms="mssql"/>
    <property name="timeType" value="time" dbms="mssql"/>
<%_ } _%>
<%_ if (databaseTypeNeo4j) { _%>
    <property name="now" value="datetime()" dbms="neo4j"/>
    <property name="floatType" value="numeric" dbms="neo4j"/>
    <property name="clobType" value="clob" dbms="neo4j"/>
    <property name="blobType" value="blob" dbms="neo4j"/>
    <property name="uuidType" value="string" dbms="neo4j"/>
    <property name="datetimeType" value="date" dbms="neo4j"/>
    <property name="timeType" value="date" dbms="neo4j"/>
<%_ } _%>

    <include file="config/liquibase/changelog/00000000000000_initial_schema.xml" relativeToChangelogFile="false"/>
    <!-- jhipster-needle-liquibase-add-changelog - JHipster will add liquibase changelogs here -->
    <!-- jhipster-needle-liquibase-add-constraints-changelog - JHipster will add liquibase constraints changelogs here -->
    <!-- jhipster-needle-liquibase-add-incremental-changelog - JHipster will add incremental liquibase changelogs here -->
</databaseChangeLog>
